import java.lang.reflect.Array;
import java.util.*;

public class test {
        public static int firstUniqChar(String s) {
            int[] count=new int['z'-'a'+1];
            for(int i=0;i<s.length();i++){
                count[s.charAt(i)-'a']++;
            }
            for(int j=0;j<count.length;j++){
                if(count[j]==1){
                    return j;
                }

            }
            return -1;


        }


    public static void main1(String[] args) {
        TreeMap<String,Integer> treeMap=new TreeMap<>();
        treeMap.put("dj",3);
        treeMap.put("aasdfa",4);
        treeMap.put("advasfdhahf",6);
        treeMap.put("ass",7);
        int val=treeMap.get("dj");
        Set<String> set=treeMap.keySet();
        Collection<Integer> collection=treeMap.values();
        Set<Map.Entry<String,Integer>> entries=treeMap.entrySet();
        for (Map.Entry<String,Integer> entry:entries){
            System.out.println("key"+entry.getKey()+"value"+ entry.getValue());
        }
        System.out.println(val);
        System.out.println(collection);


    }

    public static void main(String[] args) {
        Set<String> set=new TreeSet<>();
        set.add("assadsa");
        set.add("shdjkhajkdh");
        set.add("sasdasdas");
        for (String s:set){
            System.out.println(s);
        }
        int a=firstUniqChar("leetcode");
        System.out.println(a);


    }
}
